home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 016 / herc.arc / GMODE.ASM < prev    next >
Encoding:
Assembly Source File  |  1986-03-15  |  1.6 KB  |  78 lines

  1. ; GRAPHICS MODE FOR C FUNCTION
  2. ; GRAPHICS MODE CHANGE ROUTINE
  3.  
  4.         name   _gmode
  5.  
  6. public  _gmode
  7.  
  8. DGROUP  group   _DATA
  9.         assume  ds:DGROUP
  10.  
  11. _DATA   segment word    public  'DATA'
  12. _gtable db      35h,2dh,2eh,07h,5bh,02h,57h,57h
  13.         db      02h,03h,00h,00h,00h,00h,00h,00h
  14. _DATA   ends
  15.  
  16.  
  17. _TEXT   segment byte    public  'CODE'
  18.         assume  cs:_TEXT
  19.  
  20. _gmode  proc    near
  21.         push    bp
  22.         mov     bp, sp
  23.         push    es
  24.         push    di
  25.         push    si
  26.         mov     dx, 3bfh
  27.         mov     al, 3
  28.         out     dx, al
  29.         mov     dx,03b8h
  30.         mov     al,0a2h
  31.         out     dx,al
  32.         mov     dx,03b4h
  33.         mov     ah,00
  34.         lea     si, _gtable
  35.         mov     cx,0010h
  36. hg199:  mov     al,ah
  37.         out     dx,al
  38.         inc     dx
  39.         mov     al, [si]
  40.         out     dx,al
  41.         inc     ah
  42.         dec     dx
  43.         inc     si
  44.         loop    hg199
  45.         mov     ax,0b800h
  46.         mov     es,ax
  47.         mov     cx,4000h
  48.         mov     di,0
  49.         mov     ax,0
  50.         cld
  51.         repz    stosw
  52.         mov     dx,03bah
  53.         mov     cx,5
  54. hg1be:  in      al,dx
  55.         or      al,al
  56.         js      hg1c5
  57.         jmp     hg1be
  58. hg1c5:  in      al,dx
  59.         or      al,al
  60.         jns     hg1cc
  61.         jmp     hg1c5
  62. hg1cc:  loop    hg1be
  63.         mov     dx,03b8h
  64.         mov     al,0aah
  65.         out     dx,al
  66.         pop     si
  67.         pop     di
  68.         pop     es
  69.         mov     sp, bp
  70.         pop     bp
  71.         ret
  72. _gmode  endp
  73.  
  74. _TEXT   ends
  75.         end
  76.  
  77.  
  78.